package entity

// Auction 拍卖信息
type Auction struct {
	DCI           string `json:"dci" required:"true" example:"0x3e6cf1025bc0852b7141ab19a097305a3935ebb9cc23d4f507c6ccce112be73c"`
	Seller        string `json:"seller" required:"true" example:"0xfC97a1A683FB0108299D5725BC9d72899C9A86B4"`
	BlockNumber   uint64 `json:"blockNumber" required:"true" example:"100"`
	Deadline      string `json:"deadline" required:"true" example:"16300000000"`
	ReservePrice  string `json:"reservePrice" required:"true" example:"1000000000000000000"`
	HighestBid    string `json:"highestBid,omitempty" example:"5000000000000000000"`
	HighestBidder string `json:"highestBidder,omitempty" example:"0xb269d9Ec0a93889Cd3cc80870Bf7F6a71418Ea6B"`

	Name            string `json:"name,omitempty" required:"true"`
	Description     string `json:"description,omitempty" required:"true"`
	Category        string `json:"category,omitempty"`
	BlockTime       uint64 `json:"blockTime,omitempty" required:"true" example:"14000000"`
	BlockTimeString string `json:"blockTimeString,omitempty" required:"true" example:"2020-01-01 01:01:01"`
}

// AuctionEvent 链上拍卖事件记录
type AuctionEvent struct {
	DCI         string `json:"dci" required:"true" example:"0x3e6cf1025bc0852b7141ab19a097305a3935ebb9cc23d4f507c6ccce112be73c"`
	From        string `json:"from" required:"true" example:"0xfC97a1A683FB0108299D5725BC9d72899C9A86B4"` // create事件为Seller bid事件为Bidder
	Value       string `json:"value" required:"true" example:"1000000000000000000"`                       // create事件为ReservePrice bid事件为Bid
	TxHash      string `json:"txHash" required:"true" example:"0xd6a0c30545031249a15f8a4c3fd9b8aa9c737e5032d868b517eef1d4bbdd14b4"`
	EventName   string `json:"eventName" required:"true" example:"create"`
	BlockNumber string `json:"blockNumber" required:"true" example:"100"`
}

// GetAuctionUri 获取拍卖信息请求
type GetAuctionUri struct {
	DCI string `uri:"dci" binding:"required" path:"dci" required:"true" example:"0x3e6cf1025bc0852b7141ab19a097305a3935ebb9cc23d4f507c6ccce112be73c"`
}

// GetAuctionResponse 获取拍卖信息请求的响应
type GetAuctionResponse struct {
	Response
	Data Auction `json:"data,omitempty"`
}

// GetAuctionsQuery 获取拍卖信息集合请求
type GetAuctionsQuery struct {
	Pagination
	BlockTimeSearch
	NameSearch
	ItemTypeSearch
	DCI    string `form:"dci" query:"dci" example:"0x3e6cf1025bc0852b7141ab19a097305a3935ebb9cc23d4f507c6ccce112be73c"`
	Seller string `form:"seller" query:"seller" example:"0xfC97a1A683FB0108299D5725BC9d72899C9A86B4"`
}

// GetAuctionsResponse 获取拍卖信息集合的响应
type GetAuctionsResponse struct {
	Response
	Data []Auction `json:"data,omitempty"`
}

// GetAuctionEventsQuery 获取拍卖事件记录请求
type GetAuctionEventsQuery struct {
	Pagination
	DCI         string `form:"dci" binding:"required"  query:"dci" required:"true" example:"0x3e6cf1025bc0852b7141ab19a097305a3935ebb9cc23d4f507c6ccce112be73c"`
	Seller      string `form:"seller"  query:"seller" example:"0xfC97a1A683FB0108299D5725BC9d72899C9A86B4"`
	EventName   string `form:"eventName" query:"eventName" example:"create"`
	BlockNumber uint64 `form:"blockNumber" query:"blockNumber" example:"10000"`
}

// GetAuctionEventsResponse 获取拍卖事件记录请求的响应
type GetAuctionEventsResponse struct {
	Response
	Data []AuctionEvent `json:"data,omitempty"`
}
